import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'ToMyselfPage.dart';

class TimePage extends StatelessWidget{
  final String token;
  TimePage(this.token);
  Widget build(BuildContext context){
    return Scaffold(
      appBar: AppBar(
        title: Container(
          child: Text('时间胶囊',
            style: TextStyle(
                color: Colors.black,
                letterSpacing: 5
            ),
          ),
        ),
        centerTitle:true,
        backgroundColor: Colors.white,
        //titleSpacing: 20,
        leading: IconButton(
          icon:Icon(Icons.arrow_back,color: Colors.black),
          onPressed: () {Navigator.pop(context);},
        ),
      ),
      body: Container(
        width: double.infinity,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            RaisedButton(
                shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10)
                ),
                child: Text('写给自己'),
                textColor: Colors.black,
                color: Colors.green[100],
                padding: EdgeInsets.all(10),
                onPressed:(){Navigator.push(context, new MaterialPageRoute(builder: (context) => ToMyselfPage(this.token)));}
            ),
            RaisedButton(
                shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10)
                ),
                child: Text('写给Ta'),
                textColor: Colors.black,
                color: Colors.green[100],
                padding: EdgeInsets.all(10),
                onPressed:null
            )
          ],
        ),
        decoration: BoxDecoration(
            image: new DecorationImage(
                fit: BoxFit.cover,
                image: new AssetImage('images/timeCapsule.jpg'))),
      ),
    );
  }
}


